<div id='mod_account' title="修改注册信息">
    <form id="modAccountForm">
        <fieldset>
            <label for='uCompanyName'>&nbsp;&nbsp;公司名称：</label>
            <input type="text" name="uCompanyName" id="uCompanyName" class="input-text" style="width:66%" /><br />
            <label for="opwd">&nbsp;&nbsp;&nbsp;&nbsp;原密码：</label>
            <input type="password" name="opwd" id="opwd" class="input-text" style="width:33%" /><br />
            <label for="npwd">&nbsp;&nbsp;&nbsp;&nbsp;新密码：</label>
            <input type="password" name="npwd" id="npwd" class="input-text" style="width:33%" /><br />
            <label for="renpwd">确认新密码：</label>
            <input type="password" name="renpwd" id="renpwd" class="input-text" style="width:33%" />
        </fieldset>
    </form>
</div>

<div class="jsqf_box">
    <div class="jsqf_content">
        <div class="clear"></div>
        <div class="account_box">
        <form id="account_profilelist" name="account_profilelist" action="/account/account_profilelist.do" method="post">
            <input type="hidden" name="page" value="1" id="account_profilelist_page"/>
        </form>

            <div class="account_top">
            账号：<span><?php echo $account['u_name'];?></span>
            类型：<span><?php echo $account['u_type'];?></span>
            公司名：<span id="cpn"><?php echo $account['u_company_name'];?></span>
            充值条数：<span><?php echo $account['a_total_amount'];?></span>
            可用条数：<span><?php echo $account['a_balance_amount'];?></span>
            <a href="javascript:void(0);" id="modbtn">修改注册信息</a>
            </div>
            <div class="account_table">
                <table class="account_order">
                    <tr>
                        <td class="account_order_title">日期</td>
                        <td class="account_order_title">类型</td>
                        <td class="account_order_title">数量</td>
                        <td class="account_order_title">余额</td>
                        <td class="account_order_title">事件</td>
                        <td class="account_order_title">SP</td>
                        <td class="account_order_title">状态</td>
                    </tr>
                <?php foreach($accountLogs as $item): ?>
                    <tr>
                        <td><?php echo substr($item['al_created'], 0, 10);?></td>
                        <td><?php echo $alType[$item['al_type']];?></td>
                        <td><?php echo $item['al_amount'];?></td>
                        <td><?php echo $item['al_balance_amount'];?></td>
                        <td><?php echo $item['al_event'];?></td>
                        <td><?php echo $accountSp[$item['a_sp']]['name'];?></td>
                        <td><?php echo $alStatus[$item['al_status']];?></td>
                    </tr>
                <?php endforeach;?>
                </table>
            </div>
            <div class="pager">
               <?php echo $page;?>
            </div>
        </div>

    </div>
    <div class="clear"></div>
    <div class="jsqf_foot"></div>
</div>
</div>
<script type="text/javascript">
$( "#mod_account" ).dialog({
    autoOpen: false,
    height: 240,
    width: 350,
    modal: true,
    buttons: {
        "修改": function() {
            var _dialog = this;
            $.post('/account/edit', $("#modAccountForm").serialize(), function(data){
                if (data.code == 0) {
                    $('#cpn').text($('#uCompanyName').val());
                }

                alert(data.message);
                $( _dialog ).dialog( "close" );
            }, 'json').error(function() {
                top.window.location.href = '/login';
            });
            return false;
        },
        "取消": function() {
            $( this ).dialog( "close" );
        }
    },
    close: function() {
    }
});

$(function(){
    $('#modbtn').click(function() {
        $('#uCompanyName').val($('#cpn').text());
        $('#mod_account').dialog('open');
    });
});
</script>
